home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / lists / mint / l_0799 / 608 < prev    next >
Encoding:
Internet Message Format  |  1994-08-27  |  1.8 KB

  1. From: Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
  2. Date: Mon, 8 Nov 93 13:21:25 +0100
  3. Message-Id: <9311081221.AA26256@issan.informatik.uni-dortmund.de>
  4. To: mint@atari.archive.umich.edu
  5. In-Reply-To: <9311080935.AA19789@dutiws.twi.tudelft.nl> (schuller@dutiws.TWI.TUDelft.NL)
  6. Subject: Re: include file problems
  7.  
  8. >>>>> schuller@dutiws.TWI.TUDelft.NL (Bart Schuller) writes:
  9.  
  10. |> Hello all,
  11. |> I'm having a nasty problem with the way the MiNTlibs include hierarchy
  12. |> works. The problem:
  13. |> When compiling something using 'gcc -I. foo.c', strange things happen
  14. |> when foo.c includes a file "wait.h" or "compiler.h" . Why? because
  15. |> "wait.h" usually will include <sys/wait.h>, which in turn does a
  16. |> #include <wait.h> . At this point the error occurs, because the -I.
  17. |> option makes gcc include ./wait.h, not /usr/include/wait.h .
  18.  
  19. This can be fixed by changing 
  20.  
  21. #include <wait.h>
  22.  
  23. to 
  24.  
  25. #ifdef __GNUC__
  26. #include "../wait.h"
  27. #else
  28. #include <wait.h>
  29. #endif
  30.  
  31. in <sys/wait.h> (and also in the files in sys/). At least, it works
  32. with gcc, because it always searched first relative to the directory
  33. the include file was found.  This probably also works with other
  34. compilers, in this case this should be adjusted.
  35.  
  36. |> I think this problem could happen on any UNIX machine when you have a
  37. |> file ./stdio.h for example, but people don't usually do that.
  38. |> I think having all these MiNT specific files in /usr/include is the
  39. |> wrong thing, they should be in /usr/include/sys or /usr/include/mint.
  40.  
  41. The latter is a nice idea. The only problem is that purec doesn't grok
  42. <mint/compiler.h>, it doesn't know about forward slashes.
  43.  
  44. ----------------------------------------------------------------------
  45. Andreas Schwab                                  "And now for something
  46. schwab@ls5.informatik.uni-dortmund.de            completely different"
  47.